home *** CD-ROM | disk | FTP | other *** search
/ The Very Best of Atari Inside / The Very Best of Atari Inside 1.iso / mint / mntlib25 / eprintf.c < prev    next >
C/C++ Source or Header  |  1992-09-05  |  998b  |  36 lines

  1. #include <stdio.h>
  2. #include <stdarg.h>
  3. #include <string.h>
  4. #include "lib.h"
  5.  
  6. /* new file 4/15/92 sb
  7.    This function had to be split from the [vf]printf functions to accommodate
  8.    Sozobon's floating point libs.  Originally, anything that used the assert()
  9.    macro [like malloc()] would pull in this function and bring with it
  10.    definitions of printf et.al.; if we've already included the printf() from
  11.    libm.a, this will cause a conflict.
  12.  
  13.    5/2/92 sb
  14.    Modified to do its own work rather than call fprintf().
  15. */
  16.  
  17. #define _say(s) _write(2,s,(long)strlen(s))
  18.  
  19. static char buf[20];    /* big enough for any value of a long */
  20.  
  21. /* This is used by the `assert' macro.  */
  22. void __eprintf (expression, line, filename)
  23. const char *expression;
  24. const long line;
  25. const char *filename;
  26. {
  27.     _ltoa(line, buf, 10);
  28.     _say("assertion `");
  29.     _say(expression);
  30.     _say("' failed at line ");
  31.     _say(buf);
  32.     _say(" of file ");
  33.     _say(filename);
  34.     _say("\r\n");
  35. }
  36.